import cv2 as cv
import numpy as np


def main():
    x = np.uint8([250])
    y = np.uint8([10])
    print("普通加法结果:", x + y)
    print("cv.add结果:", cv.add(x, y))

    shape = (200, 200, 1)
    img1 = np.ones(shape, np.uint8) * 250
    img2 = np.ones(shape, np.uint8) * 10

    cv.imshow("Press any key to next", img1 + img2)
    cv.waitKey(0)

    cv.imshow("Press any key to next", cv.add(img1, img2))
    cv.waitKey(0)

    cv.destroyAllWindows()


if __name__ == "__main__":
    main()
